﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Xml.Linq;
using Microsoft.SharePoint;
using System.Text.RegularExpressions;

namespace LizardSoft.Common.FlexibleStructureDeployment
{
    public static partial class StructureHelper
    {
        private static void UpdateContentTypeNameAndDescription(SPWeb web, string listFolderUrl, SPContentTypeId listContentTypeId, SPContentType siteContentType)
        {
            SPList list = GetSPListFromFolderUrl(web, listFolderUrl);
            SPContentType listContentType = list.ContentTypes[listContentTypeId];
            if (listContentType.Name != siteContentType.Name || listContentType.Description != siteContentType.Description)
            {
                listContentType.Name = siteContentType.Name;
                listContentType.Description = siteContentType.Description;
                listContentType.Update();
            }
        }
    }
}
